package cc.htdf.gwc.forecast.aspect;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import whisper.common.exception.format.ParseException;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by JT on 2017/10/10.
 */
@RestControllerAdvice
public class ControllerExceptionAscept {

    @ExceptionHandler(value = ParseException.class)
    public Map patternExceptionHadnler(ParseException parseException) {
        Map body = new HashMap();
        body.put("code", parseException.getCode());
        body.put("message", parseException.getMessage());
        return body;
    }
}
